<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<base th:href="@{/}">
<head>
    <meta charset="UTF-8"/>
    <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
    <title>全部订单</title>

    <!-- Favicons -->
    <link rel="shortcut icon" th:href="@{/assets/images/Shop.ico}">
    <link rel="stylesheet" th:href="@{/assets/css/vendor/vendor.min.css}">
    <link rel="stylesheet" th:href="@{/assets/css/plugins/plugins.min.css}">
    <link rel="stylesheet" th:href="@{/assets/css/style.min.css}">
    <style>


        #div_body p {
            height: 40px;
            border: 1px solid #c0c0c0;
            line-height: 40px;
            text-align: center;
        }

        #div_body img {
            width: 18px;
            height: 18px;
            margin-top: 9px;
            float: right;
        }

        #div_body p:hover {
            background: #66b7f9;
            color: #ffffff;
        }

        .leftpage {
            height: 500px;
            background: #ffffff;
        }

        #adduse {
            display: none;
            width: 600px;
            height: 445px;
            border: 1px solid #c0c0c0;
            background: #ffffff;
            position: fixed;
            left: 30%;
            top: 20%;
        }

        #adduse p {
            padding-left: 15px;
        }

        .addusep {
            background: #f2f2f2;
            height: 30px;
            line-height: 30px;
            padding-left: 5px;
        }

        #adduse p:nth-child(2) {
            padding-top: 25px;
        }

        #adduse p:nth-child(6) {
            padding-bottom: 25px;
        }

        #cancle {
            margin-left: 220px;
            background: #428bca;
            color: #ffffff;
            border: none;
            width: 60px;
            height: 30px;
        }

        #save {
            margin-left: 36px;
            background: #428bca;
            color: #ffffff;
            border: none;
            width: 60px;
            height: 30px;
        }
    </style>


</head>

<body>

<div th:include="head :: headname"></div>


<!-- Breadcrumb Section Start -->
<div class="section">

    <!-- Breadcrumb Area Start -->
    <div class="breadcrumb-area bg-primary">
        <div class="container">
            <div class="breadcrumb-content">
                <ul>
                    <li>
                        <a  th:href="@{/goods/index}"><i class="fa fa-home"></i> </a>
                    </li>
                    <li class="active">全部订单</li>
                </ul>
            </div>
        </div>
    </div>
    <!-- Breadcrumb Area End -->

</div>
<!-- Breadcrumb Section End -->

<!-- Shopping Cart Section Start -->
<div class="section section-margin">
    <div class="container">

        <div class="row">
            <!--leaf-->
            <div class="col-lg-3" th:fragment="leafname">
                <!-- Sidebar Widget Start -->
                <aside class="sidebar_widget mt-10 mt-lg-0">
                    <div class="widget_inner">
                        <div class="widget-list mb-10">
                            <h3 class="widget-title mb-6">订单中心</h3>
                            <!-- Widget Menu Start -->
                            <nav>
                                <ul class="category-menu mb-n3">
                                    <li class="menu-item-has-children pb-4"><a th:href="@{order/allOrder}">全部订单 </a></li>
                                    <li class="menu-item-has-children pb-4"><a th:href="@{order/obligation}">待付款 </a></li>
                                    <li class="menu-item-has-children pb-4"><a th:href="@{order/received}">待收货 </a></li>
                                    <li class="menu-item-has-children pb-4"><a th:href="@{order/allcomment}">已评论 </a></li>
                                </ul>
                            </nav>
                            <!-- Widget Menu End -->
                        </div>
                        <div class="widget-list mb-10">
                            <h3 class="widget-title mb-6">用户中心</h3>
                            <div class="sidebar-body">
                                <ul class="sidebar-list">
                                    <li><a href="#">个人信息 </a></li>
                                    <li><a href="#">我的收藏 </a></li>
                                    <li><a href="#">地址管理 </a></li>
                                    <li><a href="#">优惠券 </a></li>
                                    <li><a href="#">积分商城 </a></li>
                                </ul>
                            </div>
                        </div>
                      <!--  <div class="widget-list mb-10">
                            <h3 class="widget-title mb-6">用户中心</h3>
                            <ul class="category-menu mb-n3">
                                <li class="menu-item-has-children pb-4">
                                    <a th:href="@{/user/personal/{id}(id=${userInfo.id})}" style="color: rgb(0, 196, 204)">个人信息
                                        <i class="fa fa-angle-left"></i></a></li>
                                <li class="menu-item-has-children pb-4">
                                    <a th:href="@{/user/accountSafe/{id}(id=${userInfo.id})}">账号安全
                                        <i class="fa fa-angle-right"></i></a></li>
                                <li class="menu-item-has-children pb-4"><a href="#">我的收藏
                                    <i class="fa fa-angle-right"></i></a></li>
                                <li class="menu-item-has-children pb-4">
                                    <a th:href="@{/user/addressBook/{id}(id=${userInfo.id})}">地址管理
                                        <i class="fa fa-angle-right"></i></a></li>
                                <li class="menu-item-has-children pb-4"><a href="#">优惠券
                                    <i class="fa fa-angle-right"></i></a></li>
                                <li class="menu-item-has-children pb-4"><a href="#">积分商城
                                    <i class="fa fa-angle-right"></i></a></li>
                            </ul>
                        </div>-->
                        <div class="widget-list">
                            <h3 class="widget-title mb-6">猜你喜欢</h3>

                            <div class="sidebar-body product-list-wrapper mb-n6">

                                <!-- Single Product List Start -->
                                <div class="single-product-list mb-6" th:each="re:${sList}">
                                    <!-- Product List Thumb Start -->
                                    <div class="product">
                                        <div class="thumb">
                                            <a href="single-product.html" class="image">
                                                <img class="fit-image first-image" th:src="${re.pic}"
                                                     alt="Product Image">
                                                <!--                                    <img class="fit-image second-image"-->
                                                <!--                                         src="assets/images/products/small-product/10.jpg" alt="Product Image">-->
                                            </a>
                                        </div>
                                    </div>
                                    <!-- Product List Thumb End -->

                                    <!-- Product List Content Start -->
                                    <div class="product-list-content">
                                        <h6 class="product-name">
                                            <a href="single-product.html" th:text="${re.name}"></a>
                                        </h6>
                                        <span class="price">
                                                    <span class="new" th:text="'￥'+${re.promotionPrice}">$12.50</span>
                                            <span class="old" th:text="'￥'+${re.price}"></span>
                                            </span>
                                    </div>
                                    <!-- Product List Content End -->

                                </div>
                                <!-- Single Product List End -->



                            </div>
                        </div>
                    </div>
                </aside>
                <!-- Sidebar Widget End -->
            </div>

            <div class=" col-lg-9">

                <!-- Cart Table Start -->
                <div class="cart-table table-responsive">
                    <table class="table table-bordered">
                        <!-- Table Head Start -->
                        <thead>
                        <tr>
                            <th colspan="4">
                                <span>
                                    <select onchange="timeChanges()" class="timeChange"
                                            style="font-weight: bold;outline: none;border: none;background-color: rgb(0,196,204);text-align: center">
                                        <option th:if="${t0} eq 0" selected th:value="0">近3个月订单</option>
                                        <option th:if="${t0} ne 0" th:value="0">近3个月订单</option>
                                        <option th:if="${t1} eq 1" selected th:value="1">今年内</option>
                                        <option th:if="${t1} ne 1" th:value="1">今年内</option>
                                        <option th:if="${t2} eq 2" selected th:value="2">全部订单</option>
                                        <option th:if="${t2} ne 2" th:value="2">全部订单</option>
                                    </select>
                                </span><span style="padding-left: 100px;padding-right: 50px">订单详情</span>
                            </th>
                            <th class="pro-thumbnail">收货人</th>
                            <th class="pro-price">总金额(￥)</th>
                            <th class="pro-quantity">
                                <select th:onchange="status()" class="status"
                                        style="font-weight: bold;outline: none;border: none;background-color: rgb(0,196,204);text-align: center">
                                    <option th:if="${s10} eq 10" selected th:value="10">全部状态</option>
                                    <option th:if="${s1} eq 1" selected th:value="1">待发货</option>
                                    <option th:if="${s2} eq 2" selected th:value="2">已发货</option>
                                    <option th:if="${s3} eq 3" selected th:value="3">已收货</option>
                                    <option th:if="${s4} eq 4" selected th:value="4">已取消</option>
                                    <option th:if="${s10} ne 10" th:value="10">全部状态</option>
                                    <option th:if="${s1} ne 1" th:value="1">待发货</option>
                                    <option th:if="${s2} ne 2" th:value="2">已发货</option>
                                    <option th:if="${s3} ne 3" th:value="3">已收货</option>
                                    <option th:if="${s4} ne 4" th:value="4">已取消</option>
                                </select>
                            </th>
                            <th class="pro-subtotal">操作</th>
                        </tr>
                        </thead>
                        <tbody th:if="${#lists.isEmpty(list)}">
                        <tr>
                            <td colspan="8">
                                <p>您目前还没有订单...</p>
                            </td>
                        </tr>
                        </tbody>
                        <tbody th:if="${#lists.size(list) > 0}" th:each="order,ors :${list}">
                        <tr>
                            <td colspan="8" style="height: 1px;border: none"></td>
                        </tr>
                        <tr style="background-color: rgb(0,196,204);">
                            <td colspan="8" style="text-align: left;color: white">
                                &emsp;&emsp;时间:<span
                                    th:text="${#dates.format(order.createTime,'yyyy-MM-dd HH:mm:ss')}"></span>&emsp;&emsp;&emsp;&emsp;订单单号：<span
                                    th:text="${order.orderSn}" style="color: white"></span>
                            </td>
                        </tr>
                        <tr th:if="${#lists.isEmpty(order.omsOrderItems)}">
                            <td colspan="8">
                                <p>无效订单：<a th:href="@{order/allOrder/delOrder(id=${order.id})}"
                                           style="padding: 5px 10px 5px 10px;color: red;border: 1px solid red">删除订单</a>
                                </p>
                            </td>
                        </tr>
                        <tr th:if="${#lists.size(order.omsOrderItems)>0}" th:each="i,s:${order.omsOrderItems}">
                            <td colspan="4" class="pro-thumbnail" style="width: 620px">
                                <div style="float: left;width: 100px;color: rgb(156,85,123)"><a th:href="@{/goods/ywt-product(id=${i.productId})}"><img
                                        th:src="${i.getProductPic()}"
                                        alt="Product" width="60"/></a></div>
                                <div style="color: rgb(156,85,123);width: 390px;"><a th:href="@{/goods/ywt-product(id=${i.productId})}" style="width: 200px"><span
                                        th:text="${i.getProductName()}"
                                        style="white-space: normal;word-wrap: break-word;width: 300px;color: rgb(156,85,123)"></span></a>
                                    <p>数量：<span th:text="${i.getProductQuantity()}"></span><span th:if="${order.status}==3" style="position: relative;left: 100px;"><a th:href="@{/order/comment(productId=${i.productId})}" style="font-size: 12px;color: #c0b9b9">追评</a></span></p>
                                </div>
                            </td>
                            <td th:if="${s.first}" th:attr="rowspan=${s.size}"><a href="#"
                                                                                  style="color: red;display: inline-block;">
                                <p style="white-space: normal;word-wrap: break-word;width: 70px;color: rgb(156,85,123)"
                                   th:text="${order.receiverName}"></p></a>
                            </td>
                            <td class="pro-price" th:if="${s.first}" th:attr="rowspan=${s.size}"
                                style="color: rgb(156,85,123)"><p
                                    style="white-space: normal;word-wrap: break-word;width: 80px;color: rgb(156,85,123)">
                                ￥<span th:text="${order.payAmount}" style="color: rgb(156,85,123)"></span></p></td>
                            <td class="pro-quantity" th:if="${s.first}" th:attr="rowspan=${s.size}"
                                style="color: rgb(156,85,123)">
                                <span th:text="${order.status}==1?'待发货':(${order.status}==2?'已发货':(${order.status}==3?'已收货':'已取消'))"></span>
                            </td>
                            <td class="pro-subtotal" th:if="${s.first}" th:attr="rowspan=${s.size}">
                                <div style="display: inline-block" th:if="${order.status}==0">
                                    <p><a onclick="cancelOrder(this)" th:attr="oid=${order.id}"
                                          style="padding: 5px 10px 5px 10px;color: red;border: 1px solid red">取消订单</a>
                                    </p>
                                </div>
                                <div style="display: inline-block" th:if="${order.status}==1">
                                    <p><a th:href="@{order/goBackOrder(id=${order.id})}"
                                          style="padding: 5px 10px 5px 10px;color: red;border: 1px solid red">申请退货</a>
                                    </p>
                                </div>
                                <div style="display: inline-block" th:if="${order.status}==2">
                                    <p><a th:href="@{order/confirmReceiptAll(id=${order.id})}"
                                          style="padding: 5px 10px 5px 10px;color: red;border: 1px solid red">确认收货</a>
                                    </p>
                                </div>
                                <div style="display: inline-block" th:if="${order.status}==3">
                                    <p><a id="div_add" onclick="findBill(this)" th:attr="oid=${order.id}"
                                          style="padding: 5px 10px 5px 10px;color: red;border: 1px solid red">查看发票</a>
                                    </p>
                                    <p><a th:href="@{order/allOrder/delOrder(id=${order.id})}"
                                          style="padding: 5px 10px 5px 10px;color: red;border: 1px solid red">删除订单</a>
                                    </p>
                                </div>
                                <div style="display: inline-block" th:if="${order.status}==4">
                                    <p><a th:href="@{order/onceOrder(id=${order.id})}"
                                          style="padding: 5px 10px 5px 10px;color: red;border: 1px solid red">重新购买</a>
                                    </p>
                                    <p><a th:href="@{order/allOrder/delOrder(id=${order.id})}"
                                          style="padding: 5px 10px 5px 10px;color: red;border: 1px solid red">删除订单</a>
                                    </p>
                                </div>
                            </td>
                        </tr>
                        </tbody>
                        <!-- Table Body End -->

                    </table>
                </div>

                <div class="row">
                    <div class="col-12">
                        <!--shop toolbar start-->
                        <div class="toolbar_wrapper mt-8 border-top pt-8">

                            <!-- Shopt Top Bar Right Start -->
                            <div class="blog-top-bar-right d-flex justify-content-center">
                                <nav>
                                    <ul class="pagination">
                                        <li class="page-item disabled upPage">
                                            <a class="page-link rounded-0" href="#" aria-label="Previous"
                                               style="border: 1px solid rgb(0,196,204)">
                                                <span aria-hidden="true">上一页</span>
                                            </a>
                                        </li>
                                        <li>
                                            <a class="page-link active" href="#"
                                               style="border: 1px solid rgb(0,196,204);border-left: none">...</a>
                                        </li>
                                        <li class="pageNum">
                                            <a class="page-link active pageNum" href="#"
                                               style="border: 1px solid rgb(0,196,204);border-left: none">1</a>
                                        </li>
                                        <li>
                                            <a class="page-link active" href="#"
                                               style="border: 1px solid rgb(0,196,204);border-left: none">...</a>
                                        </li>
                                        <li class="page-item">
                                            <a class="page-link rounded-0 nextPage" href="#" aria-label="Next"
                                               style="border: 1px solid rgb(0,196,204)">
                                                <span aria-hidden="true">下一页</span>
                                            </a>
                                        </li>
                                    </ul>
                                </nav>
                            </div>
                            <!-- Shopt Top Bar Right End -->

                        </div>
                        <!--shop toolbar end-->

                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<!-- Shopping Cart Section End -->

<!-- Footer Section Start -->
<div th:replace="footer :: footerS"></div>
<!-- Footer Section End -->


<!-- Mobile Menu Start -->
<div class="mobile-menu-wrapper">
    <div class="offcanvas-overlay"></div>

    <!-- Mobile Menu Inner Start -->
    <div class="mobile-menu-inner">

        <!-- Button Close Start -->
        <div class="offcanvas-btn-close">
            <i class="pe-7s-close"></i>
        </div>
        <!-- Button Close End -->

        <!-- Mobile Menu Inner Wrapper Start -->
        <div class="mobile-menu-inner-wrapper">
            <!-- Mobile Menu Search Box Start -->
            <div class="search-box-offcanvas">
                <form>
                    <input class="search-input-offcanvas" type="text" placeholder="Search product...">
                    <button class="search-btn"><i class="pe-7s-search"></i></button>
                </form>
            </div>
            <!-- Mobile Menu Search Box End -->

            <!-- Mobile Menu Start -->
            <div class="mobile-navigation">
                <nav>
                    <ul class="mobile-menu">
                        <li class="has-children">
                            <a href="#">Home <i class="fa fa-angle-down"></i></a>
                            <ul class="dropdown">
                                <li><a href="index.html">Home One</a></li>
                                <li><a href="index-2.html">Home Two</a></li>
                                <li><a href="index-3.html">Home Three</a></li>
                            </ul>
                        </li>
                        <li class="has-children">
                            <a href="#">Shop <i class="fa fa-angle-down" aria-hidden="true"></i></a>
                            <ul class="dropdown">
                                <li><a href="shop.html">Shop Grid</a></li>
                                <li><a href="shop-left-sidebar.html">Shop Left Sidebar</a></li>
                                <li><a href="shop-right-sidebar.html">Shop Right Sidebar</a></li>
                                <li><a href="shop-list-fullwidth.html">Shop List Fullwidth</a></li>
                                <li><a href="shop-list-left-sidebar.html">Shop List Left Sidebar</a></li>
                                <li><a href="shop-list-right-sidebar.html">Shop List Right Sidebar</a></li>
                                <li><a href="wishlist.html">Wishlist</a></li>
                                <li><a href="cart.html">Shopping Cart</a></li>
                                <li><a href="checkout.html">Checkout</a></li>
                                <li><a href="compare.html">Compare</a></li>
                            </ul>
                        </li>
                        <li class="has-children">
                            <a href="#">Product <i class="fa fa-angle-down" aria-hidden="true"></i></a>
                            <ul class="dropdown">
                                <li><a href="single-product.html">Single Product</a></li>
                                <li><a href="single-product-sale.html">Single Product Sale</a></li>
                                <li><a href="single-product-group.html">Single Product Group</a></li>
                                <li><a href="single-product-normal.html">Single Product Normal</a></li>
                                <li><a href="single-product-affiliate.html">Single Product Affiliate</a></li>
                                <li><a href="single-product-slider.html">Single Product Slider</a></li>
                                <li><a href="single-product-gallery-left.html">Gallery Left</a></li>
                                <li><a href="single-product-gallery-right.html">Gallery Right</a></li>
                                <li><a href="single-product-tab-style-left.html">Tab Style Left</a></li>
                                <li><a href="single-product-tab-style-right.html">Tab Style Right</a></li>
                                <li><a href="single-product-sticky-left.html">Sticky Left</a></li>
                                <li><a href="single-product-sticky-right.html">Sticky Right</a></li>
                            </ul>
                        </li>
                        <li class="has-children">
                            <a href="#">Pages <i class="fa fa-angle-down" aria-hidden="true"></i></a>
                            <ul class="dropdown">
                                <li><a href="about.html">About Us</a></li>
                                <li><a href="contact.html">Contact</a></li>
                                <li><a href="faq.html">Faq</a></li>
                                <li><a href="error-404.html">Error 404</a></li>
                                <li><a href="my-account.html">My Account</a></li>
                                <li><a href="login.html">Loging | Register</a></li>
                            </ul>
                        </li>
                        <li class="has-children">
                            <a href="#">Blog <i class="fa fa-angle-down" aria-hidden="true"></i></a>
                            <ul class="dropdown">
                                <li><a href="blog.html">Blog</a></li>
                                <li><a href="blog-left-sidebar.html">Blog Left Sidebar</a></li>
                                <li><a href="blog-right-sidebar.html">Blog Right Sidebar</a></li>
                                <li><a href="blog-details.html">Blog Details</a></li>
                                <li><a href="blog-details-sidebar.html">Blog Details Sidebar</a></li>
                            </ul>
                        </li>
                        <li><a href="about.html">About</a></li>
                        <li><a href="contact.html">Contact</a></li>
                    </ul>
                </nav>
            </div>
            <!-- Mobile Menu End -->

            <!-- Language, Currency & Link Start -->
            <div class="offcanvas-lag-curr mb-6">
                <div class="header-top-lan-curr-link">
                    <div class="header-top-lan dropdown">
                        <h4 class="title">Language:</h4>
                        <button class="dropdown-toggle" data-bs-toggle="dropdown">English <i
                                class="fa fa-angle-down"></i></button>
                        <ul class="dropdown-menu dropdown-menu-right">
                            <li><a class="dropdown-item" href="#">English</a></li>
                            <li><a class="dropdown-item" href="#">Japanese</a></li>
                            <li><a class="dropdown-item" href="#">Arabic</a></li>
                            <li><a class="dropdown-item" href="#">Romanian</a></li>
                        </ul>
                    </div>
                    <div class="header-top-curr dropdown">
                        <h4 class="title">Currency:</h4>
                        <button class="dropdown-toggle" data-bs-toggle="dropdown">USD <i class="fa fa-angle-down"></i>
                        </button>
                        <ul class="dropdown-menu dropdown-menu-right">
                            <li><a class="dropdown-item" href="#">USD</a></li>
                            <li><a class="dropdown-item" href="#">Pound</a></li>
                        </ul>
                    </div>
                </div>
            </div>
            <!-- Language, Currency & Link End -->

            <!-- Contact Links/Social Links Start -->
            <div class="mt-auto bottom-0">

                <!-- Contact Links Start -->
                <ul class="contact-links">
                    <li><i class="fa fa-phone"></i><a href="#"> +012 3456 789</a></li>
                    <li><i class="fa fa-envelope-o"></i><a href="#"> info@example.com</a></li>
                    <li><i class="fa fa-clock-o"></i> <span>Monday - Sunday 9.00 - 18.00</span></li>
                </ul>
                <!-- Contact Links End -->

                <!-- Social Widget Start -->
                <div class="widget-social">
                    <a title="Facebook" href="#"><i class="fa fa-facebook-f"></i></a>
                    <a title="Twitter" href="#"><i class="fa fa-twitter"></i></a>
                    <a title="Linkedin" href="#"><i class="fa fa-linkedin"></i></a>
                    <a title="Youtube" href="#"><i class="fa fa-youtube"></i></a>
                    <a title="Vimeo" href="#"><i class="fa fa-vimeo"></i></a>
                </div>
                <!-- Social Widget Ende -->
            </div>
            <!-- Contact Links/Social Links End -->
        </div>
        <!-- Mobile Menu Inner Wrapper End -->

    </div>
</div>
<form id="adduse">
    <p class="addusep">发票详情</p>
    <div class="bill">
        <span id="btn"><input type="button" value="取消" id="cancle" onclick="hideBill(this)"/> <input type="button"
                                                                                                     value="下载"
                                                                                                     id="save"
                                                                                                     onclick="saves()"/></span>
    </div>

</form>
<script th:src="@{assets/js/vendor.min.js}"></script>
<script th:src="@{assets/js/plugins.min.js}"></script>
<script th:src="@{assets/js/main.js}"></script>
<script th:src="@{/assets/js/jquery.js}"></script>
<script>
    function timeChanges() {
        location.href = '/order/timeChange?t=' + $('.timeChange').val();
    }

    function status() {
        location.href = '/order/statusChange?s=' + $('.status').val();
    }

    function saves() {
        alert("订单未完成，未开具发票");
        $("#adduse").hide()
    }

    function cancelOrder(obj) {
        var oid = obj.getAttribute("oid")
        var yesOrNo = confirm("确定取消吗?")
        console.info(oid)
        if (yesOrNo) {
            $.ajax({
                type: "get",
                url: "/order/cancelOrder?id=" + oid,
                success: function (result) {
                    if (result == 1) {
                        location.href = "/order/allOrder"
                    }
                }
            })
        }
    }

    function findBill(obj) {
        let oid = obj.getAttribute("oid")
        $.ajax({
            type: "get",
            url: "order/findBill?id=" + oid,
            success: function (result) {
                console.info(result)
                var btn = `<span id="btn"><input type="button" value="取消" id="cancle" onclick="hideBill(this)"/> <input type="button" value="下载" id="save" onclick="saves()"/></span>`
                $(".bill").html("")
                if (result.billHeader != null) {
                    var ht = `<div style="float: left;width: 80px;height: 80px;margin-left: 10px"><a href="#"><img
                                        src="${result.omsOrderItems[0].productPic}"
                                        alt="Product" width="80"/></a></div>
                                &emsp;&emsp;<div style="float: left;width: 180px;text-align: left;margin-top: -4px;margin-left: 6px;overflow: hidden">${result.omsOrderItems[0].productName}
                                数量：<span>${result.omsOrderItems.length}" </span></div>
                        <hr style="clear: both"/>
                        <p>
                        <span>发票抬头:${result.billHeader}</span>
                        </p>
                        <hr/>
                        <p>
                        <span>发票内容:${result.billContent}</span>
                        </p>
                        <hr/>
                        <p>
                        <sapn>收票人电话：${result.billReceiverPhone}</sapn>
                        </p>
                        <hr/>
                        <p>
                        <sapn>收票人邮箱：${result.billReceiverEmail}</sapn>
                        </p>
                        <hr/>`
                    $(".bill").prepend(ht);
                    $(".bill").append(btn);
                    $('#adduse').show();
                } else {
                    var ht = `<p style="text-align: center;padding: 0;margin:-5px;font-size: 25px">未开票</p>
                        <p style="text-align: center;padding: 5px;margin: 0">商家预计会在订单完成后10个自然日内开具，请耐心等待</p>
                        <hr style="margin:2px"/>
                        <div style="float: left;width: 80px;height: 80px;margin-left: 10px"><a href="#"><img
                                        src="${result.omsOrderItems[0].productPic}"
                                        alt="Product" width="80"/></a></div>
                                &emsp;&emsp;<div style="float: left;width: 180px;text-align: left;margin-top: 5px;height: 80px;overflow: hidden">${result.omsOrderItems[0].productName}
                                数量：<span>${result.omsOrderItems.length}" </span></div>
                        <hr style="clear: both"/>
                        <p style="clear: both">
                        <span>订单状态：${result.status == 0 ? "未付款" : "已完成"}</span>
                        </p>
                        <hr/>
                        <p>
                        <span>订单编号：${result.orderSn}</span>
                        </p>
                        <hr/>
                        <p>
                        <sapn>下单时间：${result.createTime}</sapn>
                        </p>
                        <hr/>`
                    $(".bill").prepend(ht);
                    $(".bill").append(btn);
                    $('#adduse').show();
                }
            }
        })
    }

    function hideBill() {
        $('#adduse').hide();
    }
</script>
<script>
    $(function () {
        $.ajax({
            url: '/order/allOrderList',
            type: "get",
            success: function (rel) {
                console.info(rel)
            }
        })
    })

</script>
</body>

</html>